<?php
$page = htmlentities($_GET['page']);

?>
<!DOCTYPE html>
<head>
	<script type="text/javascript" src="../../../../../wp-includes/js/jquery/jquery.js"></script>
	<script type="text/javascript" src="../../../../../wp-includes/js/tinymce/tiny_mce_popup.js"></script>
	<link rel='stylesheet' href='shortcodes.css' type='text/css' media='all' />
<?php
if( $page == 'box' ){
?>
	<script type="text/javascript">
		var AddBoxes = {
			e: '',
			init: function(e) {
				AddBoxes.e = e;
				tinyMCEPopup.resizeToInnerSize();
			},
			insert: function createGalleryShortcode(e) {

				var BoxType = jQuery('#BoxType').val();
				var Boxalign = jQuery('#Boxalign').val();
				var BoxClass = jQuery('#BoxClass').val();
				var BoxWidth = jQuery('#BoxWidth').val();
				var BoxContent = jQuery('#BoxContent').val();

				var output = '[box ';
		
				if(BoxType) {
					output += 'type="'+BoxType+'" ';
				}
				if(Boxalign) {
					output += 'align="'+Boxalign+'" ';
				}
				if(BoxClass) {
					output += 'class="'+BoxClass+'" ';
				}
				if(BoxWidth) {
					output += 'width="'+BoxWidth+'" ';
				}

				output += ']'+BoxContent+'[/box]';
				tinyMCEPopup.execCommand('mceReplaceContent', false, output);
				tinyMCEPopup.close();
				
			}
		}
		tinyMCEPopup.onInit.add(AddBoxes.init, AddBoxes);

	</script>
	<title>Add Box</title>

</head>
<body>
<form id="GalleryShortcode">
	<p>
		<label for="BoxType">Type of the box :</label>
		<select id="BoxType" name="BoxType">
			<option value="shadow">Shadow</option>
			<option value="info">Info</option>
			<option value="success">Success</option>
			<option value="warning">Warning</option>
			<option value="error">Error</option>
			<option value="download">Download</option>
			<option value="note">Note</option>
		</select>
	</p>
	<p>
		<label for="Boxalign">Box alignment :</label>
		<select id="Boxalign" name="Boxalign">
			<option value=""></option>
			<option value="alignright">right</option>
			<option value="alignleft">left</option>
			<option value="aligncenter">Center</option>
		</select>
	</p>
	<p>
		<label for="BoxClass">Custom Class :</label>
		<input id="BoxClass" name="BoxClass" type="text" value="" />
	</p>
	</p>
	<p>
		<label for="BoxWidth">Box Width :</label>
		<input id="BoxWidth" name="BoxWidth" type="text" value="" />
	</p>
	<p>
		<label for="BoxContent">Content : </label>
		<textarea id="BoxContent" name="BoxContent" col="20"></textarea>
	</p>
	<p><a class="add" href="javascript:AddBoxes.insert(AddBoxes.e)">insert into post</a></p>
</form>

<?php
} elseif( $page == 'buttons' ){
 ?>
 	<script type="text/javascript">
		var AddButtons = {
			e: '',
			init: function(e) {
				AddButtons.e = e;
				tinyMCEPopup.resizeToInnerSize();
			},
			insert: function createGalleryShortcode(e) {

				var ButtonColor = jQuery('#ButtonColor').val();
				var Buttonsize = jQuery('#Buttonsize').val();
				var Buttonlink = jQuery('#Buttonlink').val();
				var Buttontext = jQuery('#Buttontext').val();

				var output = '[button ';
				
				if(ButtonColor) {
					output += 'color="'+ButtonColor+'" ';
				}
				if(Buttonsize) {
					output += 'size="'+Buttonsize+'" ';
				}
				if(Buttonlink) {
					output += 'link="'+Buttonlink+'" ';
				}
				if( jQuery('#Buttontarget').is(':checked') ) {
					output += 'target="blank" ';
				}


				output += ']'+Buttontext+'[/button]';
				tinyMCEPopup.execCommand('mceReplaceContent', false, output);
				tinyMCEPopup.close();
				
			}
		}
		tinyMCEPopup.onInit.add(AddButtons.init, AddButtons);

	</script>
	<title>Add Buttons</title>

</head>
<body>
<form id="GalleryShortcode">
	<p>
		<label for="ButtonColor">Type of the box :</label>
		<select id="ButtonColor" name="ButtonColor">
			<option value="red">Red</option>
			<option value="orange">Orange</option>
			<option value="blue">Blue</option>
			<option value="green">Green</option>
			<option value="black">Black</option>
			<option value="gray">Gray</option>
			<option value="white">White</option>
			<option value="pink">Pink</option>
			<option value="purple ">Purple</option>
		</select>
	</p>
	<p>
		<label for="Buttonsize">Button Size :</label>
		<select id="Buttonsize" name="Buttonsize">
			<option value="small">Small</option>
			<option value="medium">Medium</option>
			<option value="big">Big</option>
		</select>
	</p>
	<p>
		<label for="Buttonlink">Button Link :</label>
		<input id="Buttonlink" name="Buttonlink" type="text" value="http://" />
	</p>
	<p>
		<label for="Buttontarget">Open Link in a new window : </label>
		<input id="Buttontarget" name="Buttontarget" type="checkbox" value="true" />
	</p>
	</p>
	<p>
		<label for="Buttontext">Button Text :</label>
		<input id="Buttontext" name="Buttontext" type="text" value="" />
	</p>

	<p><a class="add" href="javascript:AddButtons.insert(AddButtons.e)">insert into post</a></p>
</form>
  
<?php } elseif( $page == 'author' ){ ?>
	<script type="text/javascript">
		var Author = {
			e: '',
			init: function(e) {
				Author.e = e;
				tinyMCEPopup.resizeToInnerSize();
			},
			insert: function createGalleryShortcode(e) {

				var image = jQuery('#image').val();
				var Content = jQuery('#Content').val();


				var output = '[author ';
				
				if(image) {
					output += 'image="'+image+'" ';
				}



				output += ']'+Content+'[/author]';
				tinyMCEPopup.execCommand('mceReplaceContent', false, output);
				tinyMCEPopup.close();
				
			}
		}
		tinyMCEPopup.onInit.add(Author.init, Author);

	</script>
	<title>Author Bio</title>

</head>
<body>
<form id="GalleryShortcode">
	<p>
		<label for="image">Author Image URL</label>
		<input id="image" name="image" type="text" value="" />
	</p>
	<p>
		<label for="Content">Content : </label>
		<textarea id="Content" name="Content" col="20"></textarea>
	</p>
	
	<p><a class="add" href="javascript:Author.insert(Author.e)">insert into post</a></p>
</form>

<?php } elseif( $page == 'tabs' ){ ?>

	<script type="text/javascript">
		var Author = {
			e: '',
			init: function(e) {
				Author.e = e;
				tinyMCEPopup.resizeToInnerSize();
			},
			insert: function createGalleryShortcode(e) {


			
				var output = "[tabs ";
				var Type = jQuery('#Type').val();
				
				if(Type) {
					output += 'type="'+Type+'"';
				}
				
				output += "][tabs_head]";
				
				 jQuery("input[id^=tab_title]").each(function() {
					output +='[tab_title]'+jQuery(this).val()+'[/tab_title]';
				});
				
   				output += "[/tabs_head]";

				 jQuery("textarea[id^=Content]").each(function() {
					output +='[tab]'+jQuery(this).val()+'[/tab]';
				});
				


				output += '[/tabs]';
				tinyMCEPopup.execCommand('mceReplaceContent', false, output);
				tinyMCEPopup.close();
				
			}
		}
		tinyMCEPopup.onInit.add(Author.init, Author);

		jQuery(document).ready(function() {
			jQuery("#add-tab").click(function() {
				jQuery('#TabsShortcodeContent').append('<p><label for="tab_title[]">Tab Title</label><input id="tab_title[]" name="tab_title[]" type="text" value="" /></p><p><label for="Content[]">Tab Content</label><textarea  style="height:100px;  width:400px;" id="Content[]" name="Content[]" type="text" value=""></textarea></p>	<hr style="border-bottom: 1px solid #FFF;border-top: 1px solid #ccc; border-left:0; border-right:0;" />');
			});
		});
		
	</script>
	<title>Add Tabbed Content</title>

</head>
<body>
<form id="TabsShortcode">
<div id="TabsShortcodeContent">
	<p>
		<label for="Type">Type : </label>
		<select id="Type" name="Type">
			<option value="horizontal">Horizontal</option>
			<option value="vertical">Vertical</option>
		</select>
	</p>
	<hr style="border-bottom: 1px solid #FFF;border-top: 1px solid #ccc; border-left:0; border-right:0;" />
	<p>
		<label for="tab_title[]">Tab Title</label>
		<input id="tab_title[]" name="tab_title[]" type="text" value="" />
	</p>
	<p>
		<label for="Content[]">Tab Content</label>
		<textarea style="height:100px; width:400px;" id="Content[]" name="Content[]" type="text" value="" ></textarea>
	</p>
	<hr style="border-bottom: 1px solid #FFF;border-top: 1px solid #ccc; border-left:0; border-right:0;" />
</div>
	<strong><a style="cursor: pointer;" id="add-tab">+ Add Tab</a></strong>
	<p><a class="add" href="javascript:Author.insert(Author.e)">insert into post</a></p>
</form>

<?php } elseif( $page == 'toggle' ){ ?>

	<script type="text/javascript">
		var toggle = {
			e: '',
			init: function(e) {
				toggle.e = e;
				tinyMCEPopup.resizeToInnerSize();
			},
			insert: function createGalleryShortcode(e) {

				var Title = jQuery('#Title').val();
				var state = jQuery('#state').val();
				var Content = jQuery('#Content').val();


				var output = '[toggle ';
				
				if(Title) {
					output += 'title="'+Title+'" ';
				}
				if(state) {
					output += 'state="'+state+'" ';
				}


				output += ']'+Content+'[/toggle]';
				tinyMCEPopup.execCommand('mceReplaceContent', false, output);
				tinyMCEPopup.close();
				
			}
		}
		tinyMCEPopup.onInit.add(toggle.init, toggle);

	</script>
	<title>Add Toggle</title>

</head>
<body>
<form id="GalleryShortcode">
	<p>
		<label for="Title">Title</label>
		<input id="Title" name="Title" type="text" value="" />

	</p>
	<p>
		<label for="state">State : </label>
		<select id="state" name="state">
			<option value="open">open</option>
			<option value="close">close</option>
		</select>
	</p>
	<p>
		<label for="Content">Content : </label>
		<textarea id="Content" name="Content" col="20"></textarea>
	</p>
	
	
	<p><a class="add" href="javascript:toggle.insert(toggle.e)">insert into post</a></p>
</form>

<?php } elseif( $page == 'lightbox' ){ ?>

	<script type="text/javascript">
		var Addlightbox = {
			e: '',
			init: function(e) {
				Addlightbox.e = e;
				tinyMCEPopup.resizeToInnerSize();
			},
			insert: function createGalleryShortcode(e) {

				var ImgUrl = jQuery('#ImgUrl').val();
				var ImgTitle = jQuery('#ImgTitle').val();
				var ImgContent = jQuery('#ImgContent').val();


				var output = '[lightbox';
				
				if(ImgUrl) {
					output += ' full="'+ImgUrl+'"';
				}
				if(ImgTitle) {
					output += ' title="'+ImgTitle+'"';
				}

				output += ']'+ ImgContent + '[/lightbox]';
				tinyMCEPopup.execCommand('mceReplaceContent', false, output);
				tinyMCEPopup.close();
				
			}
		}
		tinyMCEPopup.onInit.add(Addlightbox.init, Addlightbox);

	</script>
	<title>Add LightBox</title>

</head>
<body>
<form id="GalleryShortcode">
	<p>
		<label for="ImgUrl">Full Image or Youtube / Vimeo Video URL : </label>
		<input id="ImgUrl" name="ImgUrl" type="text" value="http://" />

	</p>
	<p>
		<label for="ImgTitle">Title : </label>
		<input id="ImgTitle" name="ImgTitle" type="text" value="" />

	</p>
	<p>
		<label for="ImgContent">Content : </label>
		<textarea id="ImgContent" name="ImgContent" cols="45" rows="5" ></textarea>
	</p>
	
	<p><a class="add" href="javascript:Addlightbox.insert(Addlightbox.e)">insert into post</a></p>
</form>

<?php } elseif( $page == 'video' ){ ?>

	<script type="text/javascript">
		var AddVideo = {
			e: '',
			init: function(e) {
				AddVideo.e = e;
				tinyMCEPopup.resizeToInnerSize();
			},
			insert: function createGalleryShortcode(e) {

				var VideoUrl = jQuery('#VideoUrl').val();
				var width = jQuery('#width').val();
				var height = jQuery('#height').val();


				var output = '[embed';
				
				if(width) {
					output += ' width="'+width+'" ';
				}
				if(height) {
					output += ' height="'+height+'" ';
				}

				output += ']'+ VideoUrl + '[/embed]';
				tinyMCEPopup.execCommand('mceReplaceContent', false, output);
				tinyMCEPopup.close();
				
			}
		}
		tinyMCEPopup.onInit.add(AddVideo.init, AddVideo);

	</script>
	<title>Add Video</title>

</head>
<body>
<form id="GalleryShortcode">
	<p>
		<label for="VideoUrl" style="width:230px">Youtube / Vimeo / Dailymotion Video Url : </label>
		<input id="VideoUrl" name="VideoUrl" type="text" value="http://" />

	</p>
	<p>
		<label for="width">Width :</label>
		<input style="width:40px;" id="width" name="width" type="text" value="" />
	</p>
	<p>
		<label for="height">Height :</label>
		<input style="width:40px;"  id="height" name="height" type="text" value="" />
	</p>

	
	<p><a class="add" href="javascript:AddVideo.insert(AddVideo.e)">insert into post</a></p>
</form>


<?php } elseif( $page == 'googlemap' ){ ?>

	<script type="text/javascript">
		var googlemap = {
			e: '',
			init: function(e) {
				googlemap.e = e;
				tinyMCEPopup.resizeToInnerSize();
			},
			insert: function createGalleryShortcode(e) {

				var MapUrl = jQuery('#MapUrl').val();
				var width = jQuery('#width').val();
				var height = jQuery('#height').val();
				var align = jQuery('#Mapalign').val();


				var output = '[googlemap ';
				
				if(MapUrl) {
					output += 'src="'+MapUrl+'" ';
				}
				if(width) {
					output += 'width="'+width+'" ';
				}
				if(height) {
					output += 'height="'+height+'" ';
				}
				if(align) {
					output += 'align="'+align+'" ';
				}

				output += ']';
				tinyMCEPopup.execCommand('mceReplaceContent', false, output);
				tinyMCEPopup.close();
				
			}
		}
		tinyMCEPopup.onInit.add(googlemap.init, googlemap);

	</script>
	<title>Insert Google Map</title>

</head>
<body>
<form id="GalleryShortcode">
	<p>
		<label for="MapUrl">Map Url : </label>
		<input id="MapUrl" name="MapUrl" type="text" value="http://" />

	</p>
	<p>
		<label for="Mapalign">Map alignment :</label>
		<select id="Mapalign" name="Mapalign">
			<option value=""></option>
			<option value="alignright">right</option>
			<option value="alignleft">left</option>
			<option value="aligncenter">Center</option>
		</select>
	</p>
	<p>
		<label for="width">Width :</label>
		<input style="width:40px;" id="width" name="width" type="text" value="" />
	</p>
	<p>
		<label for="height">Height :</label>
		<input style="width:40px;"  id="height" name="height" type="text" value="" />
	</p>

	
	<p><a class="add" href="javascript:googlemap.insert(googlemap.e)">insert into post</a></p>
</form>

<?php } ?>

</body>
</html>